import request from '@/utils/request'

export default{
    //添加课程
    saveCourse(courseInfo){
        return request({
            url:`/eduservice/course`,
            method:'post',
            data:courseInfo
        })
    },
    //讲师下拉列表
    getTeachers(){
        return request({
            url:`/eduservice/teacher`,
            method:'get',
        })
    },
    // 根据id查询课程
    getCourseInfo(courseId){
        return request({
            url:`/eduservice/course/${courseId}`,
            method:'get',
        })
    },
    //修改课程
    updateCourseInfo(couseInfoVo){
        return request({
            url:`/eduservice/course`,
            method:'put',
            data:couseInfoVo
        })
    },
    //显示课程的全部信息
    getCoursePublish(courseId){
        return request({
            url:`/eduservice/course/getCoursePublish/${courseId}`,
            method:'get'
        })
    },
    //最终发布课程
    coursePublish(courseId){
        return request({
            url:`/eduservice/course/${courseId}`,
            method:'put'
        })
    },

    //分页带条件查询
    getCourseListPage(currentPage,pageSize,courseQuery){
        return request({
            url:`/eduservice/course/${currentPage}/${pageSize}`,
            method:'post',
            data:courseQuery
        })
    },
    //删除课程
    removeCourse(courseId){
        return request({
            url:`/eduservice/course/${courseId}`,
            method:'delete'
        })
    }
}
